//
// Created by 孙凌霄 on 2021/6/30.
//

#ifndef ANDROIDAWESOME_EASYPLAYER_H
#define ANDROIDAWESOME_EASYPLAYER_H

#include "JavaCallHelper.h"
#include "AudioChannel.h"
#include "VideoChannel.h"

extern "C" {
#include <libavformat/avformat.h>
}

class EasyPlayer {
public:
    EasyPlayer(JavaCallHelper *javaCallHelper, const char *dataSource);

    ~EasyPlayer();

    void prepare();

    void _prepare();

private:
    char *dataSource;
    // 在子线程解析视频源
    pthread_t pid;

    // 包含了视频的信息(宽高等)
    AVFormatContext *formatContext;

    JavaCallHelper *javaCallHelper;

    AudioChannel *audioChannel;
    VideoChannel *videoChannel;
};


#endif //ANDROIDAWESOME_EASYPLAYER_H
